function [Sigma_v,Q_sigma] = drawStochasticVolatilities_new_Simple(idiosyncratic,Sigma_v,rho,Q_sigma,prior_SV_sm)
%UNTITLED7 Summary of this function goes here
%   Detailed explanation goes here

            [Tstar,n] = size(idiosyncratic);

            logsigma = log(sqrt([Sigma_v]));
            
            ustarstarMATRIX = NaN*idiosyncratic;
            RtBig = zeros(n,n,Tstar);

            for i = 1:n
                
                u_i = idiosyncratic(:,i);
                logsigma_i = logsigma(i,:)';
                ulags_i = mlag2(u_i,2); % Note that this produces q NaN's at the beggining (OK)
                
                % Apply Cochrane Orcutt Transformation
                   
                v = u_i - ulags_i*rho(i,:)';
                
                vstarstar_i = log(v.^2+1e-3);
        
                [~, Rt_i, yss1_i] = KimShephardChib_Ivan3(vstarstar_i,logsigma_i);
                
                ustarstarMATRIX(:,i)=yss1_i;               
                RtBig(i,i,:) = Rt_i;  

            end

        [SV_filtered, Sig_SV_filtered, ~, ~] = KalmanFilterFast(ustarstarMATRIX,[],[],zeros(n,1),10*eye(n),[],eye(n),2*eye(n),[],Q_sigma,RtBig,[]);
        logsigma = Bai_Wang2(eye(n),Q_sigma,[],[],Sig_SV_filtered,SV_filtered,n);
        
        Sigma_v = (exp(logsigma)).^2;
       
        
        % Conditional on the Previous Draw of the SV sequence, draw the "vol of vol"

        for ii=1:n

                d_logsigma_u = logsigma(:,ii)-mlag2(logsigma(:,ii),1);
                d_logsigma_u = d_logsigma_u(5:end,:); % I supress a couple of observations to reduce dependency from initial conditions. Question: Should we discard missing observations here?

                % PRIOR FOR SV 
                sQ_sigma_vm = prior_SV_sm;
                dfQ_sigma_vm = 1;

                Q_sigma(ii,ii) = DrawIW(d_logsigma_u,sQ_sigma_vm,dfQ_sigma_vm);
        end
        
        Sigma_v = Sigma_v';

end

